package creative.fire.interview.amazon.prepare;

/**
 * @author feuyeux@gmail.com 2011-3-17
 */
public class Dividing {
	public int[] divide(int divisor, int dividend) {
		int quotient = 0;

		int compare = dividend;

		while (compare <= divisor) {
			quotient++;
			compare += dividend;
		}

		int remainder = divisor - (compare - dividend);
		return new int[] { quotient, remainder };
	}

	public static void main(String[] args) {
		Dividing d = new Dividing();
		int[] a = d.divide(121, 11);
		System.out.println(a[0] + " " + a[1]);
	}
}